﻿﻿//下拉栏目设置
var dropdownCategoryTree;
var setting = {
    data: {
        simpleData: {
            enable: true,
            idKey: "categoryId",
            pIdKey: "parentId",
            rootPId: 0
        }
    },
    async: {
        enable: true,
        url: $("#ParentId_Tree").attr("data-ns-url")
    },
    callback: {
        onClick: function (event, treeId, treeNode) {
            $("#ParentId").val(treeNode.categoryId);
            $("#ParentId_Text").text(treeNode.name);
            $("#ParentId_Dropdown").hide();
        },
        onAsyncSuccess: function (event, treeId, treeNode, msg) {
            var node = dropdownCategoryTree.getNodeByParam("categoryId", $('#ParentId').val(), null);
            dropdownCategoryTree.selectNode(node);
            dropdownCategoryTree.expandAll(true);
            $('#ParentId_Text').text(node.name);
        }
    }
};

//模块类型显示
function ModuleType() {
    if ($("#ModuleType").val() > 0) {
        $("#content_inputbox").show();
    }
    else {
        $("#content_inputbox").hide();
    }
}
//栏目类型显示
function Input_Type() {
    switch ($("#Type").val()) {
        case "1":
            $("#general_inputbox").show();
            $("#link_inputbox").hide();
            break;
        case "2":
            $("#general_inputbox").hide();
            $("#link_inputbox").hide();
            break
        case "3":
            $("#general_inputbox").hide();
            $("#link_inputbox").show();
            break;
    }
}